<template>
    <!-- 背景颜色 -->
    <div class="module_bg" :style="[ styles ]"></div>
</template>

<script>
export default {
    props: {
        base: {
            type: Object,
            required: true
        },
        bgColor: {
            type: String
        }
    },
    computed:{
        styles(){
            let style = {}, base = this.base
            switch (base.bg) {
                case 1:
                    style.background = this.bgColor || '#fff'
                    break;
                case 2:
                    style.background = 'none'
                    break;
                case 3:
                    style.background = base.bc
                    base.bt === 2 && (style.background = `${base.bc} url(${base.bi}) center center / cover no-repeat`)
                    break;
                default:
                    break;
            }
            return style
        }
    },
}
</script>

<style lang="scss" scoped></style>

